﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ComputerList.aspx.vb" Inherits="DirectoryWeb.ComputerList" CodePage="932" %>

<!DOCTYPE html>

<script src="Scripts/directory.js" type="text/javascript"></script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>コンピューターリスト</title>
  <style type="text/css">
    .auto-style1 {
      width: 75px;
    }
  </style>
</head>
<body>
  <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
      <table>
        <tr>
          <td>一覧</td>
          <td style="text-align:right"><asp:Label ID="CountLabel" runat="server"></asp:Label>
          </td>
          <td style="width:10px"></td>
          <td>詳細</td>
        </tr>
        <tr>
          <td colspan="2" style="vertical-align:top">
            <asp:UpdatePanel ID="ComputerUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:ListBox ID="ComputerListBox" runat="server" AutoPostBack="True" Rows="16" 
                  TabIndex="1" DataSourceID="ComputerDataSource" DataTextField="Name" 
                  DataValueField="Name" Width="210px"></asp:ListBox>
                <asp:ObjectDataSource ID="ComputerDataSource" runat="server" 
                  OldValuesParameterFormatString="original_{0}" SelectMethod="GetComputers" 
                  TypeName="Library.Computer"></asp:ObjectDataSource>
              </ContentTemplate>
            </asp:UpdatePanel>
            <br />
            <br />
            <asp:UpdatePanel ID="GroupUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:Button ID="GroupButton" runat="server" Text="ネストした全所属グループの表示" Width="210px" TabIndex="31" Enabled="False" Height="27px" />
              </ContentTemplate>
            </asp:UpdatePanel>
          </td>
          <td></td>
          <td style="vertical-align:top">
            <asp:UpdatePanel ID="DetailUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:FormView ID="DetailFormView" runat="server" DataSourceID="DetailDataSource" Width="480px">
                  <ItemTemplate>
                    <table>
                      <tr style="height:25px">
                        <td class="auto-style1">DNS 名</td>
                        <td style="width:120px">
                            <asp:Label ID="FullNameLabel" runat="server" Text='<%# Eval("FullName") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">役割</td>
                        <td>
                            <asp:Label ID="RoleLabel" runat="server" Text='<%# Eval("Role") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">サイト</td>
                        <td>
                            <asp:Label ID="SiteLabel" runat="server" Text='<%# Eval("Site") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">説明</td>
                        <td>
                          <asp:TextBox ID="DescriptionTextBox" runat="server" TabIndex="11" 
                            MaxLength="64" Width="370px" Text='<%# Bind("Description") %>'></asp:TextBox>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">OS</td>
                        <td>
                            <asp:Label ID="OperatingSystemLabel" runat="server" Text='<%# Eval("OperatingSystem") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">OSバー　ジョン</td>
                        <td>
                            <asp:Label ID="OperatingSystemVersionLabel" runat="server" Text='<%# Eval("OperatingSystemVersion") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">OS SP</td>
                        <td>
                            <asp:Label ID="OperatingSystemServicePackLabel" runat="server" Text='<%# Eval("OperatingSystemServicePack") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td class="auto-style1">所属パス</td>
                        <td>
                          <asp:Label ID="DisplayPathLabel" runat="server" Text='<%# Eval("DisplayPath") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align:top" class="auto-style1">所属する　グループ</td>
                        <td>
                          <asp:ListBox ID="GroupListBox" runat="server" Rows="5" TabIndex="20" 
                            DataSourceID="GroupDataSource" Width="250px"></asp:ListBox>
                        </td>
                      </tr>
                    </table>
                  </ItemTemplate>
                  <EmptyDataTemplate>
                    <asp:Literal ID="Literal1" runat="server" Text="一覧からコンピューターを選択してください。" EnableViewState="False"></asp:Literal>
                  </EmptyDataTemplate>
                </asp:FormView>
                <asp:ObjectDataSource ID="DetailDataSource" runat="server" 
                  OldValuesParameterFormatString="original_{0}" SelectMethod="FindByName" TypeName="Library.Computer">
                  <SelectParameters>
                    <asp:ControlParameter ControlID="ComputerListBox" Name="name" PropertyName="SelectedValue" Type="String" />
                  </SelectParameters>
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="GroupDataSource" runat="server" 
                  OldValuesParameterFormatString="original_{0}" SelectMethod="GetBelongGroups" TypeName="Library.Computer">
                  <SelectParameters>
                    <asp:ControlParameter ControlID="ComputerListBox" Name="name" PropertyName="SelectedValue" Type="String" />
                  </SelectParameters>
                </asp:ObjectDataSource>
              </ContentTemplate>
              <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ComputerListBox" EventName="SelectedIndexChanged" />
              </Triggers>
            </asp:UpdatePanel>
          </td>
        </tr>
      </table>
      <asp:Button ID="Button1" runat="server" Text="戻る" TabIndex="51" />
    </div>
  </form>
</body>
</html>
